import { getFeature } from 'utils/features';
import intl from '../../locale';

// 原 yunxiao-user-profile 中codeup逻辑
import Personalsettings from 'components/PersonalSettings/loadable';

const navs = [
  {
    key: 'ssh',
    title: intl.get({
      id: 'ssh_secret',
      defaultMessage: 'SSH 公钥',
    }),
    plugin: <Personalsettings type="SshKey" />,
  },
  getFeature('personal.settings.gpg') && {
    key: 'gpg',
    title: intl.get({
      id: 'gpg_secret',
      defaultMessage: 'GPG 公钥',
    }),
    plugin: <Personalsettings type="Gpg" />,
  },
  getFeature('personal.settings.httpsPw') && {
    key: 'httpsPw',
    title: intl.get({
      id: 'https_secret',
      defaultMessage: 'HTTPS 密码',
    }),
    plugin: <Personalsettings type="HttpsPw" />,
  },
  {
    key: 'personalAccessToken',
    title: intl.get({
      id: 'personal_access_token',
      defaultMessage: '个人访问令牌',
    }),
    plugin: <Personalsettings type="PersonalAccessToken" />,
  },
].filter(item => !!item);

export default navs;
